<?php
	include ('../config/validacao.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"http://www.w3.org/TR/html4/strict.dtd">
<html lang="pt_BR">
<head>
	<meta charset="utf-8">
	<link rel="icon" type="image/png" href="../images/icone.png">
	<title><?php include('../titulo.php')?></title>
	<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
 	
	<link rel="stylesheet" href="../css/jquery-ui-1.8.21.custom.css" type="text/css" media="all" />
	<link rel="stylesheet" href="../css/index.css"  media="screen"> 
	<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css"  media="screen"> 
	
	<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script> 
	<script type="text/javascript" src="../js/bootstrap-inputmask.js"/></script>
	
    <script type="text/javascript" src="../js/jquery.validate.min.js"></script> 
	<script type="text/javascript" language="javascript" >
		$(document).ready(function(){
			$('#form').validate({  
				rules: {  
					sigla: { required: true },
					secretaria: { required: true }
					
				},  
				messages: {  
					sigla: { required: 'Preencha o campo'},
					secretaria: { required: 'Preencha o campo'}
				},  
				submitHandler: function( form ){  
					var dados = $( form ).serialize();  
					$.ajax({  
						type: "POST",  
						url: "c_secretaria.php",  
						data: dados,  
						success: function( data )  
						{  
							alert( data );
							$("input[name='sigla']").val('');
							$("input[name='secretaria']").val('');
							$("input[name='sigla']").focus();
						}  
					});  
	  				return false;  
				}  
			}); 
		}); 
	</script>

	
</head>
<body onload="$('#consulta').select()">
	<div id="container">
		<div id="topo" style="text-align:left;position:absolute;">
			<?php include('../cabecalho.php') ?>
		</div>
		<br><br>
		<div id="body">
			<form id="form">
				<fieldset>
				<legend>Cadastro de Local (Secretaria)</legend>
				<label>Sigla</label>
				<input  class="input-small" type="text"  name="sigla" onChange="javascript:this.value=this.value.toUpperCase();"/>
				<label>Nome local</label>
				<input class="input-xxlarge" type="text" name="secretaria" onChange="javascript:this.value=this.value.toUpperCase();"/>
				<br>
				<button type="submit" class="btn">Cadastrar</button>
				</fieldset>
				</form>
		</div>
	</div>
</body>
</html>
